package com.sangcomz.fishbun.ext;

import ohos.agp.components.Component;
import ohos.agp.window.dialog.ToastDialog;

public final class ViewExtKt {
    public static final void showSnackBar(Component component, int resId, int duration) {
        showSnackBar(component, component.getContext().getString(resId), duration);

    }

    public static final void showSnackBar(Component component, CharSequence charSequence, int duration) {
        if (charSequence != null && charSequence.length() != 0) {
            new ToastDialog(component.getContext()).setText(charSequence.toString()).setDuration(duration).show();
        }
    }

}
